<?php
include_once("Form/FormValidation.php");

print '<ul class="errorList">';

//handle any errors from the newProcessForm.php file
switch($_GET['error']) {
	case "temppass":
		print "<li>There was an error generating your temporary password. Please try again.</li>";	
		break;
	case "email":
		print "<li>Email addresses did not match.</li>";	
		break;
	case "username":
		print '<li>Username and/or email address is already taken.&nbsp;&nbsp;&nbsp;<a href="index.php?action=resetPassword">Reset My Password</a></li>';		
		break;
}

$validator = new FormValidation();
//output any errors coming from form validation
print $validator->getPostIfSet("err_txtFirstName")?"<li>".$validator->getPostIfSet("err_txtFirstName")."</li>":"";
print $validator->getPostIfSet("err_txtLastName")?"<li>".$validator->getPostIfSet("err_txtLastName")."</li>":"";
print $validator->getPostIfSet("err_txtUsername")?"<li>".$validator->getPostIfSet("err_txtUsername")."</li>":"";
print $validator->getPostIfSet("err_txtEmail")?"<li>".$validator->getPostIfSet("err_txtEmail")."</li>":"";
print '</ul>';
?>

<style>
<!--
.frmNewAccountField 
{
	border:1px solid #8d6727;	
}

.frmNewAccountSubmit
{
	border:1px solid #8d6727;
	background:#e4c894;
}
.frmNewAccountLabel 
{
	font-weight:bold;
}

.errorList
{
	color:red;
}
-->
</style>

<form name="frmNewAccount" action="index.php?action=newProcessForm" method="post">
<table border="0">
	<tr>
		<td>To create a new Living Word Online account fill out the form below.</td>
	</tr>
	<tr>
		<td><br></td>
	</tr>
	<tr>
		<td>
			<table cellpadding="5">
				<tr>
					<td class="frmNewAccountLabel">First Name</td>
					<td><input class="frmNewAccountField" size="20" name="txtFirstName" type="text"></td>
				</tr>
				<tr>
					<td class="frmNewAccountLabel">Last Name</td>
					<td><input class="frmNewAccountField" size="30" name="txtLastName" type="text"></td>
				</tr>
				<tr><td><br></td></tr>
				<tr>
					<td class="frmNewAccountLabel">Username</td>
					<td><input class="frmNewAccountField" size="15" name="txtUsername" type="text"></td>
				</tr>
				<tr><td><br></td></tr>
				<tr>
					<td class="frmNewAccountLabel">Email</td>
					<td><input class="frmNewAccountField" size="30" name="txtEmail" type="text"></td>
				</tr>
				<tr>
					<td class="frmNewAccountLabel">Confirm Email</td>
					<td><input class="frmNewAccountField" size="30" name="txtConfirmEmail" type="text"></td>
				</tr>
				<tr>
					<td><input class="frmNewAccountSubmit" name="btnSubmit" type="submit" value="Submit"></td>
				</tr>
			</table>
		</td>
	</tr>
</table>
</form>
